{% extends 'ApiCloud/Base/layout.common.html.twig' %}

{% block main %}
    {% include "ApiCloud/Base/inc.head.light.html.twig" with {title:"物料出入库",back:1} %}
    <mu-tabs :value.sync="tab" color="amber600" indicator-color="amber600" inverse center>
        <mu-tab>领取物料</mu-tab>
        <mu-tab>领取记录</mu-tab>
    </mu-tabs>
    <div class="pad10" v-if="tab == 0">
        <mu-form ref="form" :model="en"  label-position="top" label-width="100">
            <mu-form-item label="选择物料" :rules="[rules.notNull]" prop="mid">
                <mu-select v-model="en.mid" full-width>
                    <mu-option v-for="option,index in matters"
                               :key="index" :label="option" :value="index"></mu-option>
                </mu-select>
            </mu-form-item>
            <mu-form-item label="变动形式" :rules="[rules.notNull]" prop="isAdd">
                <mu-select v-model="en.isAdd" full-width>
                    <mu-option v-for="option,index in types"
                               :key="index" :label="option" :value="index"></mu-option>
                </mu-select>
                {#<mu-radio v-model="en.isAdd" :value="index" :label="item" v-for="item,index in types"></mu-radio>#}
            </mu-form-item>
            <mu-form-item label="数量" :rules="[rules.isNum]" prop="num">
                <mu-text-field v-model="en.num"></mu-text-field>
            </mu-form-item>
            {#<mu-form-item label="领料/入库人" :rules="[rules.notNull]" prop="userName">#}
                {#<mu-text-field v-model="en.userName"></mu-text-field>#}
            {#</mu-form-item>#}
            <mu-form-item label="用途" :rules="[rules.notNull]" prop="siteId">
                <mu-select v-model="en.siteId" full-width>
                    <mu-option v-for="option,index in sites"
                               :key="index" :label="option" :value="index"></mu-option>
                </mu-select>
            </mu-form-item>
            <mu-form-item label="备注" :rules="[rules.notNull]" prop="userName">
                <mu-text-field v-model="en.userName"  multi-line :rows="3" :rows-max="6"></mu-text-field>
            </mu-form-item>

            <div class="fs8 c11 pad5 mart20">
                <mu-button large full-width round color="primary" @click="submit()">保存提交</mu-button>
            </div>
        </mu-form>
    </div>
    <div class="pad5" v-if="tab == 1">
        <div class="bdso fs8 c12 bc13 round3 pad3 mar5" v-for="item in list">
            <div class="flrc pad5 bdbda">
                <div class="">物料名称：</div>
                <div class="flex3">[[item.Matter_name]]</div>
                <div class="">[[item.MatterLog_num]]</div>
                <div class="padl3">[[item.ConfCat_name]]</div>
            </div>
            <div class="flrc pad5 bdbda">
                <div class="">领取时间：</div>
                <div class="flex1">[[item.MatterLog_add_time]]</div>
                <div class="">领取人：</div>
                <div class="">[[item.MatterLog_user_Name]]</div>
            </div>
        </div>
    </div>
{% endblock %}
